Skip to content

Conversation

@CoMPaTech
Copy link
Member

@CoMPaTech CoMPaTech commented Jan 11, 2026

Also leverages core's use of uv for all packages instead of cherry-picking

Summary by CodeRabbit

  • New Features

    • Added device mode icons and labels for Plugwise (cooling, auto, boost, comfort, eco, off)
  • Improvements

    • Reorganized configuration flow, options, errors and translations for clearer UI and consistent keys
    • Enforced JSON key ordering and added Prettier-based formatting checks
    • Expanded formatter ignore patterns to skip additional non-UI files
    • Streamlined local init/test scripts and tightened linting rules
    • Updated CI setup to ensure required system dependencies for testing

✏️ Tip: You can customize this high-level summary in your review settings.

@CoMPaTech CoMPaTech requested a review from a team as a code owner January 11, 2026 11:28
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 11, 2026

Walkthrough

Adds Prettier JSON-sorting pre-commit hook and config, expands Prettier ignore patterns, restructures Plugwise icons/strings/translations, centralizes venv/uv/setup flow and adds ulimit/prettierrc validation in core-testing.sh, and re-enables Ruff rule UP038 in pyproject.toml.

Changes

Cohort / File(s) Summary
Pre-commit / Prettier
\.pre-commit-config.yaml, .prettierignore, .prettierrc.js
Adds mirrors-prettier hook (prettier with prettier-plugin-sort-json), bumps shellcheck-py, adjusts biome-lint rev/name, expands .prettierignore, and adds Prettier overrides enforcing JSON key ordering (including special ordering for manifests and custom_components).
Plugwise icons
custom_components/plugwise/icons.json
Updates icon mappings and ordering for DHW and regulation modes (adds comfort, eco, cooling, reorders auto/boost/off).
Plugwise strings (core)
custom_components/plugwise/strings.json
Major restructure: nests config flow (abort/error/step/user), adds exceptions and options, renames/reorders many entity keys (sensors, selects, numbers, switches), and updates services key order.
Plugwise translations
custom_components/plugwise/translations/.../en.json, custom_components/plugwise/translations/.../nl.json
Re-nests translations under a top-level config object, mirrors strings.json reorganizations, introduces exceptions and options, and relocates/renames many entity and service keys.
Core testing script
scripts/core-testing.sh
Adds ulimit -n 65536, centralizes venv/uv setup via a venv_and_uv flow, prefers uv-driven venv then script/setup, switches to manifest-driven module installs, and inserts .prettierrc validation and manifest-prep checks.
Project lint config
pyproject.toml
Removes UP038 from ignore list (enables Ruff rule UP038).
CI workflow deps
.github/workflows/test.yml
Adds apt-get system dependency installation steps required for HA-core testing before cache-key computation.

Sequence Diagram(s)

sequenceDiagram
  actor Developer
  participant Script as core-testing.sh
  participant Venv as VirtualEnv
  participant UV as uv (task runner)
  participant Setup as script/setup
  participant Prettier as Prettier validation

  Developer->>Script: invoke core-testing.sh
  Script->>Venv: ensure/create venv (ulimit set)
  Script->>UV: ensure uv installed/available in venv
  UV->>Venv: install/run pytest & tools if needed
  Script->>Setup: run script/setup to finalize env and install module from manifest
  Script->>Prettier: validate/sync .prettierrc.js and .prettierignore
  Script->>Developer: environment ready / proceed with tests
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

Suggested labels

core-dev-compat, dependencies, quality, pre-commit

Suggested reviewers

  • bouwew

Poem

🐰 I hopped through JSON keys and set them straight,
I nudged icons, raised ulimits, primed the venv gate,
I taught Prettier to sort manifests with care,
Small rabbit hops — neat code everywhere,
🥕 Merge on, friends, with tidy flair!

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Auto-sorting core style' is vague and does not clearly convey the main changes. While the PR includes Prettier configuration and JSON sorting, the title does not reflect this primary focus or explain what 'core style' means. Consider clarifying the title to reflect the actual changes, such as 'Add Prettier configuration for JSON auto-sorting' or 'Configure auto-formatting with Prettier and core-style alignment'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch jsonauto

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@CoMPaTech CoMPaTech added enhancement New feature or request downstreaming Things that are changed on HA-core side and to be applied to -beta labels Jan 11, 2026
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error while testing for Development HA-core:

⚠️ Warning: Incompatible while testing against dev HA-core.
✔️ Success: No problem with testing against released HA-core.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error while testing for Development HA-core:

⚠️ Warning: Incompatible while testing against dev HA-core.
✔️ Success: No problem with testing against released HA-core.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error while testing for Development HA-core:

⚠️ Warning: Incompatible while testing against dev HA-core.
✔️ Success: No problem with testing against released HA-core.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
custom_components/plugwise/strings.json (1)

40-66: Missing low_battery binary sensor in source strings.

The low_battery binary sensor is missing from the source strings.json but present in nl.json. Per learnings, this entity (defined as BATTERY_STATE in const.py) should be included. Since strings.json is the source file for translations, adding it here will ensure consistency across all translation files.

Proposed fix to add missing translation
       "heating_state": {
         "name": "Heating"
       },
+      "low_battery": {
+        "name": "Low battery"
+      },
       "plugwise_notification": {
         "name": "Plugwise notification"
       },
🤖 Fix all issues with AI agents
In @.pre-commit-config.yaml:
- Around line 61-68: Update the Prettier hook to a patched release by changing
the repo rev and the additional_dependencies entry that currently reference
v3.6.2/[email protected] to a fixed version (e.g., bump both rev and prettier@ to a
patched release >=3.6.3 or the latest stable release); target the hook with id
"prettier" and the additional_dependencies line "[email protected]" so both are
updated together to the chosen patched version.

In @.prettierrc.js:
- Around line 1-24: The jsonSortOrder values are using computed RegExp keys
(e.g., [/.*/]) which become non-serializable objects when passed to
JSON.stringify; update both occurrences so the regex keys are plain strings
(e.g., use "/.*/" instead of [/.*/]) inside the objects used by jsonSortOrder so
JSON.stringify({ "/.*/": "numeric" }) is produced; keep the existing
JSON.stringify(...) calls and only change the property keys to string literals
in the jsonSortOrder entries.

In @custom_components/plugwise/translations/en.json:
- Around line 40-66: The English translations are missing the low_battery binary
sensor entry; add a "low_battery" key under "entity" -> "binary_sensor" with an
appropriate name (e.g., "Low battery") so the English file matches nl.json and
other locales; this corresponds to the BATTERY_STATE binary sensor defined in
const.py and should mirror the existing pattern used by other sensors like
"flame_state" and "heating_state".
- Around line 67-71: Add the missing button.reboot translation entry to nl.json
to match en.json/strings.json; specifically add a "button" object containing
"reboot": {"name": "<Dutch translation>"} (e.g., "Herstarten") so the
key/button.reboot exists in nl.json with the Dutch label.

In @custom_components/plugwise/translations/nl.json:
- Around line 227-229: The translation key heating_setpoint has a leading space
in its "name" value; remove the leading space so the string is "Instelling
verwarmen" (update the "heating_setpoint" -> "name" value to eliminate the
initial whitespace).
- Around line 68-70: Add the missing "button" translation block to the Dutch
translations by inserting a "button" object with the "reboot" key and its Dutch
label (matching the structure used in en.json/strings.json); update the nl.json
JSON structure so it contains "button": { "reboot": "<Dutch label>" } at the
same level as "climate" to keep format and keys consistent with the other locale
files.
🧹 Nitpick comments (1)
scripts/core-testing.sh (1)

68-79: Prefer explicit venv directory checks.

The venv setup logic at the script's beginning creates a venv if $VIRTUAL_ENV is not set, but later at line 166 the script checks if [ ! -d "venv" ]. Consider using consistent checks to avoid creating multiple virtual environments.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8666153 and fb3e078.

📒 Files selected for processing (8)
  • .pre-commit-config.yaml
  • .prettierignore
  • .prettierrc.js
  • custom_components/plugwise/icons.json
  • custom_components/plugwise/strings.json
  • custom_components/plugwise/translations/en.json
  • custom_components/plugwise/translations/nl.json
  • scripts/core-testing.sh
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: CoMPaTech
Repo: plugwise/plugwise-beta PR: 0
File: :0-0
Timestamp: 2025-01-25T20:42:24.862Z
Learning: The linting rules in plugwise-beta have been updated to use TC001/TC002/TC003 instead of TCH001/TCH002/TCH003 for type-checking related rules.
Learnt from: CoMPaTech
Repo: plugwise/plugwise-beta PR: 789
File: .pre-commit-config.yaml:3-3
Timestamp: 2024-12-08T11:23:47.692Z
Learning: CoMPaTech considers Python 3.13 stable and prefers to use it in the project.
📚 Learning: 2025-01-25T20:42:24.862Z
Learnt from: CoMPaTech
Repo: plugwise/plugwise-beta PR: 0
File: :0-0
Timestamp: 2025-01-25T20:42:24.862Z
Learning: The linting rules in plugwise-beta have been updated to use TC001/TC002/TC003 instead of TCH001/TCH002/TCH003 for type-checking related rules.

Applied to files:

  • .prettierignore
📚 Learning: 2025-01-25T20:42:24.862Z
Learnt from: CoMPaTech
Repo: plugwise/plugwise-beta PR: 0
File: :0-0
Timestamp: 2025-01-25T20:42:24.862Z
Learning: In the plugwise-beta project, `uv` package manager was removed from core-testing.sh in favor of pip due to issues it was causing.

Applied to files:

  • scripts/core-testing.sh
📚 Learning: 2026-01-07T19:13:26.648Z
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 998
File: custom_components/plugwise/translations/nl.json:60-62
Timestamp: 2026-01-07T19:13:26.648Z
Learning: In all Plugwise translation files (e.g., custom_components/plugwise/translations/*.json), ensure the low_battery binary_sensor (defined as BATTERY_STATE in const.py) is included with the correct Dutch label. This keeps translations in sync with available entities and avoids missing translations.

Applied to files:

  • custom_components/plugwise/translations/nl.json
  • custom_components/plugwise/translations/en.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Prepare and validate pre-commit
  • GitHub Check: Prepare and validate pre-commit
  • GitHub Check: Prepare and validate pre-commit
🔇 Additional comments (9)
.prettierignore (1)

1-5: LGTM!

The expanded ignore patterns appropriately focus Prettier on JSON files while excluding markdown, YAML, tests, and GitHub workflows. Self-ignoring the configuration file is good practice.

custom_components/plugwise/icons.json (2)

69-73: LGTM!

The new icon mappings for dhw_mode states are semantically appropriate:

  • comfortmdi:sofa
  • ecomdi:leaf

The existing icons for auto, boost, and off maintain consistency with Material Design patterns.


87-91: LGTM!

The addition of the cooling state with mdi:snowflake icon is appropriate and aligns well with the existing heating-related icons. The icon choices maintain visual consistency across regulation modes.

scripts/core-testing.sh (3)

30-31: LGTM!

The ulimit increase to 65536 file descriptors aligns with modern Python tooling requirements, particularly for uv and Astral tools. This prevents file descriptor exhaustion during package operations.


166-178: Verify the reintroduction of uv.

The script now prefers uv for venv creation when available, falling back to standard venv. However, according to project learnings, uv was previously removed from this script due to issues it was causing.

Ensure that the issues that led to uv's removal have been resolved, or clarify why it's being reintroduced in this limited capacity (venv creation only).

Based on learnings, uv was previously problematic in this script.


191-196: LGTM!

The prettierrc validation ensures that changes to the core Home Assistant Prettier configuration are properly propagated to the plugwise-beta repository. The sed transformation correctly adjusts paths from homeassistant to custom_components.

custom_components/plugwise/strings.json (1)

1-345: Structure and content look good overall.

The reorganization to a top-level config object with nested abort, error, and step sections follows Home Assistant's integration translation conventions. The alphabetical sorting (from Prettier) improves maintainability.

custom_components/plugwise/translations/nl.json (2)

60-62: low_battery is correctly included here.

This translation file correctly includes the low_battery binary sensor. However, this entity is missing from en.json and strings.json - those files should be updated to match.


1-343: Dutch translations are comprehensive and well-structured.

The reorganization aligns with the English translations, and the Dutch text is appropriately localized. The new options section and select_gateway_mode entity have proper Dutch translations.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error while testing for Development HA-core:

⚠️ Warning: Incompatible while testing against dev HA-core.
✔️ Success: No problem with testing against released HA-core.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error while testing for Development HA-core:

⚠️ Warning: Incompatible while testing against dev HA-core.
✔️ Success: No problem with testing against released HA-core.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
scripts/core-testing.sh (2)

30-32: Consider clarifying the comment.

The term "astral-uv" in the comment is non-standard. Consider rephrasing to "core and uv expectations" or "uv expectations" for clarity.

📝 Suggested comment clarification
-# Ensure ulimit is setup to match core/astral-uv expectations
+# Ensure ulimit is setup to match core and uv expectations
 ulimit -n 65536

171-178: Consider consistent indentation.

These lines use space indentation (8 spaces) while other parts of the script may use different indentation styles. For consistency, consider aligning with the project's shell script indentation convention.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fb3e078 and c839df7.

📒 Files selected for processing (1)
  • scripts/core-testing.sh
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CoMPaTech
Repo: plugwise/plugwise-beta PR: 0
File: :0-0
Timestamp: 2025-01-25T20:42:24.862Z
Learning: The linting rules in plugwise-beta have been updated to use TC001/TC002/TC003 instead of TCH001/TCH002/TCH003 for type-checking related rules.
Learnt from: CoMPaTech
Repo: plugwise/plugwise-beta PR: 789
File: .pre-commit-config.yaml:3-3
Timestamp: 2024-12-08T11:23:47.692Z
Learning: CoMPaTech considers Python 3.13 stable and prefers to use it in the project.
📚 Learning: 2025-01-25T20:42:24.862Z
Learnt from: CoMPaTech
Repo: plugwise/plugwise-beta PR: 0
File: :0-0
Timestamp: 2025-01-25T20:42:24.862Z
Learning: In the plugwise-beta project, `uv` package manager was removed from core-testing.sh in favor of pip due to issues it was causing.

Applied to files:

  • scripts/core-testing.sh
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Prepare and validate pre-commit
🔇 Additional comments (3)
scripts/core-testing.sh (3)

190-197: LGTM! Prettierrc sync logic is correct.

The validation correctly ensures that the project's .prettierrc.js stays synchronized with HA core's configuration, with appropriate path transformations. This aligns well with the PR's objective of adopting core's auto-sorting style.


213-217: The current implementation correctly extracts and installs the requirement from manifest.json. The manifest currently contains a single requirement (plugwise==1.11.2), and the code handles it properly. If multiple requirements are added to the manifest in the future, the code would pass all of them to uv pip install without issue.


171-178: No actionable issues. The uv integration uses a proper fallback pattern that gracefully handles missing dependencies. The most recent refinement commit indicates this approach is working as intended.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error while testing for Development HA-core:

⚠️ Warning: Incompatible while testing against dev HA-core.
✔️ Success: No problem with testing against released HA-core.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In @.pre-commit-config.yaml:
- Line 70: The pre-commit hook revision for the Biome hook was changed to "rev:
v2.3.10" from v2.3.11; confirm whether this downgrade is intentional and either
(a) restore the intended revision value (e.g., set "rev" back to v2.3.11) if the
downgrade was accidental, or (b) add a brief comment in the hook configuration
or PR description explaining the intentional rollback (e.g., compatibility/bug
workaround for v2.3.11) so reviewers understand the reason; reference the "rev:
v2.3.10" line and the previously used v2.3.11 in your change.
- Line 55: The pre-commit config references a non-existent shellcheck-py tag
("rev: v0.11.0.1"); update that rev to a valid tag from the shellcheck-py
repository (or replace with the latest stable tag) so the hook can be fetched
successfully, and also resolve the version mismatches: restore biome to the
intended v2.3.11 (remove the accidental downgrade to v2.3.10) and make the
prettier pin consistent by aligning the mirror and additional_dependencies to
the same version (e.g., change additional_dependencies to [email protected] or
change the mirror to 3.6.2) so all three entries (shellcheck-py rev, biome, and
prettier mirror/additional_dependencies) reference valid, matching versions.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c839df7 and 5153280.

📒 Files selected for processing (1)
  • .pre-commit-config.yaml
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: CoMPaTech
Repo: plugwise/plugwise-beta PR: 0
File: :0-0
Timestamp: 2025-01-25T20:42:24.862Z
Learning: The linting rules in plugwise-beta have been updated to use TC001/TC002/TC003 instead of TCH001/TCH002/TCH003 for type-checking related rules.
Learnt from: CoMPaTech
Repo: plugwise/plugwise-beta PR: 789
File: .pre-commit-config.yaml:3-3
Timestamp: 2024-12-08T11:23:47.692Z
Learning: CoMPaTech considers Python 3.13 stable and prefers to use it in the project.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Setup for HA-core (release/master)
  • GitHub Check: Setup for HA-core (dev)
🔇 Additional comments (2)
.pre-commit-config.yaml (2)

74-74: Good clarification of the hook's purpose.

The updated name accurately reflects that this hook runs biome, not spelling checks. The previous name appeared to be incorrectly copied from the codespell hook.


61-68: No action required. The prettier configuration uses compatible versions: [email protected] is a valid release and satisfies the peerDependencies requirement of [email protected] (which requires prettier >=3). Using a specific version (3.6.2) rather than the mirror repo's latest tag (v3.7.4) is a normal and intentional pattern for pre-commit hooks.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error while testing for Development HA-core:

⚠️ Warning: Incompatible while testing against dev HA-core.
✔️ Success: No problem with testing against released HA-core.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error while testing for Development HA-core:

⚠️ Warning: Incompatible while testing against dev HA-core.
✔️ Success: No problem with testing against released HA-core.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
custom_components/plugwise/translations/nl.json (2)

16-16: Typo in Dutch translation: "Initaliseren" should be "Initialiseren".

Missing letter 'i' in the Dutch word.

🔤 Suggested fix
-      "stick_init": "Initaliseren van USB-stick mislukt",
+      "stick_init": "Initialiseren van USB-stick mislukt",

14-14: Mixed Dutch/English: "Network" should be "Netwerk".

The word "Network" is English while the rest of the message is Dutch.

🔤 Suggested fix
-      "network_timeout": "Network communicatie timeout",
+      "network_timeout": "Netwerk communicatie timeout",
🤖 Fix all issues with AI agents
In @custom_components/plugwise/translations/nl.json:
- Around line 20-37: The translation uses inconsistent terminology for port:
change the value for key step.reconfigure.data.port ("Port nummer") to the
correct and consistent Dutch term "Poortnummer" to match step.user.data.port and
keep translations uniform.

In @scripts/core-testing.sh:
- Around line 62-69: The venv_and_uv function blindly sources venv/bin/activate
which breaks when the virtualenv isn't present; add a guard that checks for the
activate script (e.g., test -f "venv/bin/activate" or
"${coredir}/venv/bin/activate") before sourcing and, if missing, print a clear
error and return a non-zero status (or create the venv if desired) to avoid an
uncaught failure; then continue with the existing uv check/installation. Ensure
you update the venv_and_uv function name and the exact path used in the source
call so they match.
🧹 Nitpick comments (2)
custom_components/plugwise/translations/en.json (1)

1-348: Translation file structure looks correct.

The English translation file is properly structured with all required sections (config, entity, exceptions, options, services) and includes the low_battery binary_sensor as expected. Based on learnings, this aligns with the requirement to keep translations in sync with available entities.

One minor branding note on line 330: "Homekit" should be "HomeKit" (capital K) to match Apple's official branding.

🔤 Suggested fix
-          "homekit_emulation": "Homekit emulation (i.e. on hvac_off => Away) *) beta-only option",
+          "homekit_emulation": "HomeKit emulation (i.e. on hvac_off => Away) *) beta-only option",
custom_components/plugwise/strings.json (1)

1-348: Strings file is consistent with en.json.

The source strings file structure and content align correctly with the English translation file. All entity keys, error messages, and configuration options are properly defined.

Same minor branding suggestion as en.json: line 330 should use "HomeKit" instead of "Homekit".

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5153280 and 1027701.

📒 Files selected for processing (5)
  • custom_components/plugwise/strings.json
  • custom_components/plugwise/translations/en.json
  • custom_components/plugwise/translations/nl.json
  • pyproject.toml
  • scripts/core-testing.sh
💤 Files with no reviewable changes (1)
  • pyproject.toml
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: CoMPaTech
Repo: plugwise/plugwise-beta PR: 0
File: :0-0
Timestamp: 2025-01-25T20:42:24.862Z
Learning: The linting rules in plugwise-beta have been updated to use TC001/TC002/TC003 instead of TCH001/TCH002/TCH003 for type-checking related rules.
Learnt from: CoMPaTech
Repo: plugwise/plugwise-beta PR: 789
File: .pre-commit-config.yaml:3-3
Timestamp: 2024-12-08T11:23:47.692Z
Learning: CoMPaTech considers Python 3.13 stable and prefers to use it in the project.
📚 Learning: 2026-01-07T19:13:26.648Z
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 998
File: custom_components/plugwise/translations/nl.json:60-62
Timestamp: 2026-01-07T19:13:26.648Z
Learning: In all Plugwise translation files (e.g., custom_components/plugwise/translations/*.json), ensure the low_battery binary_sensor (defined as BATTERY_STATE in const.py) is included with the correct Dutch label. This keeps translations in sync with available entities and avoids missing translations.

Applied to files:

  • custom_components/plugwise/translations/nl.json
  • custom_components/plugwise/translations/en.json
📚 Learning: 2025-01-25T20:42:24.862Z
Learnt from: CoMPaTech
Repo: plugwise/plugwise-beta PR: 0
File: :0-0
Timestamp: 2025-01-25T20:42:24.862Z
Learning: The linting rules in plugwise-beta have been updated to use TC001/TC002/TC003 instead of TCH001/TCH002/TCH003 for type-checking related rules.

Applied to files:

  • custom_components/plugwise/translations/en.json
📚 Learning: 2026-01-07T19:13:34.937Z
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 998
File: custom_components/plugwise/translations/nl.json:60-62
Timestamp: 2026-01-07T19:13:34.937Z
Learning: The low_battery binary_sensor (defined as BATTERY_STATE in custom_components/plugwise/const.py) is a valid entity in the Plugwise integration and should be included in translation files.

Applied to files:

  • custom_components/plugwise/strings.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Prepare and validate pre-commit
🔇 Additional comments (4)
custom_components/plugwise/translations/nl.json (1)

60-62: Low battery translation is present as required.

The low_battery binary_sensor is correctly included with Dutch translation "Batterij status", keeping translations in sync with available entities. Based on learnings, this is a required translation key.

scripts/core-testing.sh (3)

30-32: LGTM: Appropriate ulimit configuration.

The ulimit setting ensures sufficient file descriptors for uv and core operations, which is especially important for dependency resolution and parallel operations.


175-182: LGTM: Proper venv initialization flow.

The logic correctly separates venv creation from environment setup via script/setup, which aligns with HA core's recommended setup process. The re-activation after script/setup ensures the venv is properly configured.


194-201: LGTM: Excellent automation for config synchronization.

The prettierrc validation ensures formatting rules stay synchronized with HA core, automatically updating when core's config changes. The path transformation (homeassistantcustom_components) is appropriate for the custom component structure.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error while testing for Development HA-core:

⚠️ Warning: Incompatible while testing against dev HA-core.
✔️ Success: No problem with testing against released HA-core.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error while testing for Development HA-core:

⚠️ Warning: Incompatible while testing against dev HA-core.
✔️ Success: No problem with testing against released HA-core.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @scripts/core-testing.sh:
- Around line 198-203: The variable expansions for prettierrc are unquoted;
change all occurrences of ${prettierrc} in the diff and sed calls to quoted
expansions (e.g., "${prettierrc}" and "../${prettierrc}") so the process
substitution and redirection use a single, safe token; update both the diff -q
<(sed 's/homeassistant/custom_components/g' "${prettierrc}") "../${prettierrc}"
and the sed 's/homeassistant/custom_components/g' ${prettierrc} >
../${prettierrc} usages to use quoted "${prettierrc}" forms.
🧹 Nitpick comments (1)
scripts/core-testing.sh (1)

62-72: Add defensive check for venv existence

The function sources venv/bin/activate without verifying the venv exists. While the current script flow ensures venv creation before calling this function, adding a defensive check would improve robustness and reusability.

♻️ Proposed defensive check
 venv_and_uv() {
+       if [ ! -d "venv" ]; then
+         echo -e "${CFAIL}venv directory not found${CNORM}"
+         return 1
+       fi
        # shellcheck disable=SC1091
        source venv/bin/activate
 	if ! [ -x "$(command -v uv)" ]; then
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1027701 and 62ef74d.

📒 Files selected for processing (1)
  • scripts/core-testing.sh
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: CoMPaTech
Repo: plugwise/plugwise-beta PR: 0
File: :0-0
Timestamp: 2025-01-25T20:42:24.862Z
Learning: The linting rules in plugwise-beta have been updated to use TC001/TC002/TC003 instead of TCH001/TCH002/TCH003 for type-checking related rules.
Learnt from: CoMPaTech
Repo: plugwise/plugwise-beta PR: 789
File: .pre-commit-config.yaml:3-3
Timestamp: 2024-12-08T11:23:47.692Z
Learning: CoMPaTech considers Python 3.13 stable and prefers to use it in the project.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Prepare and validate pre-commit
🔇 Additional comments (5)
scripts/core-testing.sh (5)

30-32: LGTM - ulimit setting for file descriptors

Setting the file descriptor limit early in the script is appropriate for ensuring compatibility with HA-core and uv expectations.


178-185: LGTM - consolidated venv setup flow

The venv creation and setup flow is well-structured: checks for venv existence, creates if needed using uv, runs setup script, and activates the environment.


212-212: LGTM - venv_and_uv usage in pip_prep

The venv_and_uv call is appropriately placed, as core_prep ensures venv existence before this stage.


231-231: LGTM - consistent venv_and_uv usage

The venv_and_uv calls in the testing and quality sections follow the same safe pattern as pip_prep.

Also applies to: 263-263


286-286: LGTM - final venv_and_uv usage

The venv_and_uv call for the copy-back operations is consistent with other usages throughout the script.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error while testing for Development HA-core:

⚠️ Warning: Incompatible while testing against dev HA-core.
✔️ Success: No problem with testing against released HA-core.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error while testing for Development HA-core:

⚠️ Warning: Incompatible while testing against dev HA-core.
✔️ Success: No problem with testing against released HA-core.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error while testing for Development HA-core:

⚠️ Warning: Incompatible while testing against dev HA-core.
✔️ Success: No problem with testing against released HA-core.

@sonarqubecloud
Copy link

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @scripts/core-testing.sh:
- Around line 62-75: The venv_and_uv function currently uses a fragile check `uv
pip list | grep -q bcrypt` to decide whether to run `script/setup`; replace this
with a robust readiness check: have `script/setup` write a marker file (e.g.,
.env_ready) or check for a clear, single package like `homeassistant`, or verify
multiple required packages exist; update venv_and_uv to test for that marker
file (or multiple packages) before invoking `script/setup`, and keep the
existing checks for `uv` and `pytest` intact so the function reliably detects a
completed environment instead of relying on presence of `bcrypt`.
🧹 Nitpick comments (1)
.github/workflows/test.yml (1)

55-60: Consider unique step names for better log clarity.

Both steps share the name "Core dependencies", which may make workflow logs harder to parse. Consider naming them distinctly (e.g., "Update apt cache" and "Install Core system dependencies").

♻️ Suggested improvement
-      - name: Core dependencies
-        id: core-dependencies-1
-        run: sudo apt-get update
-      - name: Core dependencies
-        id: core-dependencies-2
-        run: sudo apt-get install python3-pip python3-dev python3-venv autoconf libssl-dev libxml2-dev libxslt1-dev libjpeg-dev libffi-dev libudev-dev zlib1g-dev pkg-config libavformat-dev libavcodec-dev libavdevice-dev libavutil-dev libswscale-dev libswresample-dev libavfilter-dev ffmpeg libgammu-dev build-essential
+      - name: Update apt cache
+        id: core-dependencies-1
+        run: sudo apt-get update
+      - name: Install Core system dependencies
+        id: core-dependencies-2
+        run: |
+          sudo apt-get install \
+            python3-pip python3-dev python3-venv \
+            autoconf libssl-dev libxml2-dev libxslt1-dev \
+            libjpeg-dev libffi-dev libudev-dev zlib1g-dev \
+            pkg-config libavformat-dev libavcodec-dev \
+            libavdevice-dev libavutil-dev libswscale-dev \
+            libswresample-dev libavfilter-dev ffmpeg \
+            libgammu-dev build-essential
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 62ef74d and b7bb796.

📒 Files selected for processing (3)
  • .github/workflows/test.yml
  • custom_components/plugwise/translations/nl.json
  • scripts/core-testing.sh
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: CoMPaTech
Repo: plugwise/plugwise-beta PR: 0
File: :0-0
Timestamp: 2025-01-25T20:42:24.862Z
Learning: The linting rules in plugwise-beta have been updated to use TC001/TC002/TC003 instead of TCH001/TCH002/TCH003 for type-checking related rules.
Learnt from: CoMPaTech
Repo: plugwise/plugwise-beta PR: 789
File: .pre-commit-config.yaml:3-3
Timestamp: 2024-12-08T11:23:47.692Z
Learning: CoMPaTech considers Python 3.13 stable and prefers to use it in the project.
📚 Learning: 2026-01-07T19:13:26.648Z
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 998
File: custom_components/plugwise/translations/nl.json:60-62
Timestamp: 2026-01-07T19:13:26.648Z
Learning: In all Plugwise translation files (e.g., custom_components/plugwise/translations/*.json), ensure the low_battery binary_sensor (defined as BATTERY_STATE in const.py) is included with the correct Dutch label. This keeps translations in sync with available entities and avoids missing translations.

Applied to files:

  • custom_components/plugwise/translations/nl.json
📚 Learning: 2025-01-25T20:42:24.862Z
Learnt from: CoMPaTech
Repo: plugwise/plugwise-beta PR: 0
File: :0-0
Timestamp: 2025-01-25T20:42:24.862Z
Learning: The linting rules in plugwise-beta have been updated to use TC001/TC002/TC003 instead of TCH001/TCH002/TCH003 for type-checking related rules.

Applied to files:

  • custom_components/plugwise/translations/nl.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Setup for HA-core (dev)
  • GitHub Check: Setup for HA-core (release/master)
🔇 Additional comments (12)
custom_components/plugwise/translations/nl.json (8)

3-8: LGTM: Config abort messages properly structured.

The new nested config.abort structure is well-organized with appropriate Dutch translations for abort scenarios.


9-19: LGTM: Comprehensive error message translations.

All error scenarios are properly translated into Dutch with clear, user-friendly messages.


20-38: LGTM: Config flow steps well-structured.

Both reconfigure and user steps contain complete Dutch translations for all data fields and descriptions.


60-62: Low battery sensor included as expected.

The low_battery binary sensor is properly included with the Dutch label "Batterij status", consistent with the requirement to keep translations in sync with available entities.

Based on learnings, this sensor (defined as BATTERY_STATE in const.py) should be present in all Plugwise translation files.


299-323: LGTM: Exception messages properly translated.

All exception messages include appropriate Dutch translations with correct placeholder syntax where needed (e.g., {error}).


325-341: LGTM: Options flow properly structured.

The new options section correctly handles both scenarios:

  • init step with configurable options (including beta-only features clearly marked)
  • none step for when no options are available

All Dutch translations are complete and descriptive.


342-347: LGTM: Service translation complete.

The delete_notification service has both description and name properly translated. The field ordering (description before name) appears to be from the auto-sorting applied as mentioned in the PR title.


48-50: No action required. All entity translation keys correspond to actual definitions in the codebase. Verification confirms:

  • cooling_state (const.py:36)
  • secondary_boiler_state (const.py:41)
  • reboot button (const.py:23)
  • maximum_boiler_temperature (const.py:79)
  • select_gateway_mode (const.py:138, used in select.py)
  • All electricity_* and voltage_* sensors (const.py:89-127)

These translations are not unused and properly support existing entities in the integration.

scripts/core-testing.sh (4)

30-31: Verify ulimit behavior in restricted environments.

The ulimit -n 65536 command may fail in containerized or restricted environments where users lack permission to modify limits. Since set -e is active, this would abort the script.

Consider making this more resilient:

♻️ Suggested safeguard
-# Ensure ulimit is setup to match core/astral-uv expectations
-ulimit -n 65536
+# Ensure ulimit is setup to match core/astral-uv expectations
+ulimit -n 65536 || echo -e "${CWARN}Could not set ulimit (may be restricted in your environment)${CNORM}"

181-188: LGTM!

The initialization flow is clear: ensure venv exists, run setup, and activate. The messaging helps users understand the preparation steps.


215-215: LGTM!

The centralized venv_and_uv helper improves maintainability by consolidating venv/uv setup logic. The consistent usage across different sections is good practice.

Also applies to: 234-234, 266-266, 289-289


201-207: No issue found with sed replacement in prettierrc synchronization.

The .prettierrc.js file contains only custom_components references and no instances of "homeassistant" text. Since the sed pattern 's/homeassistant/custom_components/g' has no matching text to replace, the command is harmless and produces no unintended side effects.

Likely an incorrect or invalid review comment.

Copy link
Contributor

@bouwew bouwew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great update, nice work!

@CoMPaTech
Copy link
Member Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 11, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@CoMPaTech CoMPaTech merged commit 4612dca into main Jan 11, 2026
13 checks passed
@CoMPaTech CoMPaTech deleted the jsonauto branch January 11, 2026 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

downstreaming Things that are changed on HA-core side and to be applied to -beta enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants